<div class="content">
	<div class="breadLine">
		<ul class="breadcrumb">
			<li><a href="">Quản trị</a> <span class="divider">&gt;</span></li>
			<li class="active">Sản phẩm</li>
		</ul>
	</div>
	<div class="workplace">
		<div class="row-fluid">
			<div class="span12">
				<div class="head">
					<div class="isw-documents"></div>
					<h1>Thêm sản phẩm</h1>
					<div class="clear"></div>
				</div>
				<form accept-charset="utf-8" method="post" action="<?php echo base_url()."admin/san-pham/them.html";?>" id="">
					<div class="block-fluid">
						<div class="row-form">
							<div class="span3">Chủng loại sản phẩm</div>
							<div class="span9">
								<select name="cate_id">
									<?php foreach ($category as $categorys): ?>
									<option value="<?php echo $categorys['cate_id'];?>"><?= $categorys['cate_name'];?></option>
									<?php endforeach;?>
								</select>
							</div>
							<div class="clear"></div>
						</div>
					
						<div class="row-form">
							<div class="span3">Tên sản phẩm</div>
							<div class="span9">
								<?php echo form_error('title')?>
								<input type="text" placeholder="Tên sản phẩm " value=""
									name="title" id="title" />
							</div>
							<div class="clear"></div>
						</div>
						<script type="text/javascript">

function BrowseServer( startupPath, functionData )
{
	// You can use the "CKFinder" class to render CKFinder in a page:
	var finder = new CKFinder();

	// The path for the installation of CKFinder (default = "/ckfinder/").
	finder.basePath = '../';

	//Startup path in a form: "Type:/path/to/directory/"
	finder.startupPath = startupPath;

	// Name of a function which is called when a file is selected in CKFinder.
	finder.selectActionFunction = SetFileField;

	// Additional data to be passed to the selectActionFunction in a second argument.
	// We'll use this feature to pass the Id of a field that will be updated.
	finder.selectActionData = functionData;

	// Name of a function which is called when a thumbnail is selected in CKFinder.
	finder.selectThumbnailActionFunction = ShowThumbnails;

	// Launch CKFinder
	finder.popup();
}

// This is a sample function which is called when a file is selected in CKFinder.
function SetFileField( fileUrl, data )
{
	document.getElementById( data["selectActionData"] ).value = fileUrl;
}

// This is a sample function which is called when a thumbnail is selected in CKFinder.
function ShowThumbnails( fileUrl, data )
{
	// this = CKFinderAPI
	var sFileName = this.getSelectedFile().name;
	document.getElementById( 'thumbnails' ).innerHTML +=
			'<div class="thumb">' +
				'<img src="' + fileUrl + '" />' +
				'<div class="caption">' +
					'<a href="' + data["fileUrl"] + '" target="_blank">' + sFileName + '</a> (' + data["fileSize"] + 'KB)' +
				'</div>' +
			'</div>';

	document.getElementById( 'preview' ).style.display = "";
	// It is not required to return any value.
	// When false is returned, CKFinder will not close automatically.
	return false;
}
	</script>
						
						
						<div class="row-form">
							<div class="span3">Ảnh sản phẩm 1</div>
							<div class="span6">
								<input id="img1" name="img1" type="text" size="60" />
									
							</div>
							<div class="span2">
								<input type="button" class="btn btn-info" value="Browse Server" onclick="BrowseServer( 'Files:/', 'img1' );" />
							</div>
							
							<div class="clear"></div>
						</div>
						
						<div class="row-form">
							<div class="span3">Ảnh sản phẩm 2</div>
							<div class="span6">
								<input id="img2" name="img2" type="text" size="60" />
									
							</div>
							<div class="span2">
								<input type="button" class="btn btn-info" value="Browse Server" onclick="BrowseServer( 'Files:/', 'img2' );" />
							</div>
							
							<div class="clear"></div>
						</div>
						
						<div class="row-form">
							<div class="span3">Ảnh sản phẩm 3</div>
							<div class="span6">
								<input id="img3" name="img3" type="text" size="60" />
									
							</div>
							<div class="span2">
								<input type="button" class="btn btn-info" value="Browse Server" onclick="BrowseServer( 'Files:/', 'img3' );" />
							</div>
							
							<div class="clear"></div>
						</div>
						
						
						
						
						
						
						<div class="row-form">
							<div class="span1">Mô tả ngắn:</div>
							<div class="span11">
								<textarea class="ckeditor" name="description1"
									placeholder="Nhập thông tin chi tiết..."></textarea>
							</div>
							<div class="clear"></div>
						</div>
						
						
						<div class="row-form">
							<div class="span3">Công nghệ</div>
							<div class="span9">
								<select name="tech_id">
									<?php foreach ($technology as $technologys): ?>
									<option value="<?php echo $technologys['tech_id'];?>"><?= $technologys['tech_name'];?></option>
									<?php endforeach;?>
								</select>
							</div>
							<div class="clear"></div>
						</div>
						
						<div class="row-form">
							<div class="span3">Xuất xứ</div>
							<div class="span9">
								<select name="origin_id">
									<?php foreach ($origin as $origins): ?>
									<option value="<?php echo $origins['origin_id'];?>"><?= $origins['origin_name'];?></option>
									<?php endforeach;?>
								</select>
							</div>
							<div class="clear"></div>
						</div>
						
						<div class="row-form">
							<div class="span3">Tình trạng hàng</div>
							<div class="span9">
								<?php echo form_error('rate')?>
								<select name="rate">
									<option value="1">Còn hàng</option>
									<option value="2">Hết hàng</option>
									<option value="3">Sắp có hàng</option>
								</select>
							</div>
							<div class="clear"></div>
						</div>
						
						<div class="row-form">
							<div class="span3">Giá niêm yết</div>
							<div class="span9">
								<?php echo form_error('priceny')?>
								<input type="text" placeholder="Giá niêm yết sản phẩm " value=""
									name="priceny" id="priceny" />
							</div>
							<div class="clear"></div>
						</div>
						<div class="row-form">
							<div class="span3">Giá</div>
							<div class="span9">
								<?php echo form_error('price')?>
								<input type="text" placeholder="Giá sản phẩm " value=""
									name="price" id="price" />
							</div>
							<div class="clear"></div>
						</div>
						
						
						<div class="row-form">
							<div class="span3">Thương hiệu</div>
							<div class="span9">
								<select name="brand_id">
									<?php foreach ($brand as $brands): ?>
									<option value="<?php echo $brands['brand_id'];?>"><?= $brands['brand_name'];?></option>
									<?php endforeach;?>
								</select>
							</div>
							<div class="clear"></div>
						</div>
						
						
						<div class="row-form">
							<div class="span3">Khoảng giá</div>
							<div class="span9">
								<select name="aprice_id">
									<?php foreach ($aboutprice as $aboutprices): ?>
									<option value="<?php echo $aboutprices['aprice_id'];?>"><?= $aboutprices['aprice_name'];?></option>
									<?php endforeach;?>
								</select>
							</div>
							<div class="clear"></div>
						</div>
						
						<div class="row-form">
							<div class="span3">Công xuất</div>
							<div class="span9">
								<select name="capacity_id">
									<?php foreach ($capacity as $capacitys): ?>
									<option value="<?php echo $capacitys['capacity_id'];?>"><?= $capacitys['capacity_name'];?></option>
									<?php endforeach;?>
								</select>
							</div>
							<div class="clear"></div>
						</div>
						
						<div class="row-form">
							<div class="span1">Chi tiết sản phẩm:</div>
							<div class="span11">
								<textarea class="ckeditor" name="description2"
									placeholder="Nhập thông tin chi tiết..."></textarea>
							</div>
							<div class="clear"></div>
						</div>
						
						<div class="row-form">
							<div class="span1">Meta keyword :</div>
							<div class="span11">
								<textarea class="" name="metakey"
									placeholder="Meta keyword "></textarea>
							</div>
							<div class="clear"></div>
						</div>
						
						<div class="row-form">
							<div class="span1">Meta Description :</div>
							<div class="span11">
								<textarea class="" name="metades"
									placeholder="Meta Description..."></textarea>
							</div>
							<div class="clear"></div>
						</div>
						
						
						<div class="row-form">
							<div class="span3">Vị trí</div>
							<div class="span9">
								<?php echo form_error('order')?>
								<input type="text" placeholder="Vị trí" value=""
									name="order" id="order" />
							</div>
							<div class="clear"></div>
						</div>
						<div class="row-form">
							<div class="span3">Trạng thái:</div>
							<div class="span9">
								<label><input type="radio" name="status" value="0" checked></input>Hiện</label>
								<label><input type="radio" name="status" value="1"></input>Ẩn</label>
							</div>
							<div class="clear"></div>
						</div>

						<div class="row-form">
							<div class="span9">
								<p>
									<button class="btn btn-success" type="submit" id="add">Thêm mới</button>
								</p>
							</div>
							<div class="clear"></div>
						</div>
					</div>
				</form>
			</div>
		</div>
	</div>
</div>
